package com.fita.wechat.dao;

import java.util.Date;

import com.demo2do.core.persistence.annotation.Dao;
import com.demo2do.core.persistence.annotation.Query;
import com.demo2do.core.persistence.annotation.Variable;
import com.fita.entity.data.ExchangeRate;

/**
 * 
 * @author dan
 *
 */
@Dao("hibernate")
public interface ExchangeRateDao {
    
    /**
     * 
     * @param currencyCode
     * @param date
     * @return
     */
    @Query("FROM ExchangeRate WHERE currencyCode = :currencyCode AND effectiveTime <= :date ORDER BY effectiveTime DESC")
    public ExchangeRate load(@Variable("currencyCode") String currencyCode, @Variable("date") Date date);

}
